// import { http } from '../utils/request.js';
// 供应商
import http from '~/utils/request.js'

let app = getApp();

var url = {
    supnumb: "base/ms-company-store/get/threeCount/sample",
    companyType: "base/companyType/list",
    companystore: "public/store",

    storeClass: "storeClassification/",
    addstoreClass: "storeClassification/create",
    updatastoreClass: "storeClassification/update",
    delstoreClass: "storeClassification/delete",

    parameterlist: "safeguard-parameter/list",
    addproduct: "pmt/product/add",

    companylist: "base/ms-company-store/get/storeName/more",
    companyitem: "base/ms-company-store/get/store",

    speclist: "specification/list",
    createspec: "specification/create",
    updataspec: "specification/update",
    delspec: "specification/delete",

    productlist: "pmt/product/list",
    productalllist: "pmt/product/getList",

    productcount: "pmt/product/count",
    upOrDown: "pmt/product/upOrDown",

    supplierList: "pmt/product/supplierList",

    allclassifupdata: "storeClassification/get/by/update",

    ourderlist: "supplier/list",
    ourderstartslist:"supplier/stateStatistics",
    ourderstate:"supplier/stateStatistics",
    
    ourderfalse:"supplier/verificationRequest",
    ourderconsig:"supplier/consignment",
    ourdertermination:"supplier/termination",

    ourderReceipt:"supplier/confirmReceipt",

    returnaddresslist:"head-address/returnState/list",
    returnaddress:"head-address/returnState/create",
    updatereturnaddress:"head-address/returnState/update",
    
    


    ourderKTaudit:"supplier/KTaudit",
    
    threeCountsample:"base/ms-company-store/get/threeCount/sample/ord",

    earchOne:"base/ms-company-store/get/threeCount/sample/ord/earchOne",

    squareSearch:"public/search",
    storeSearch:"base/ms-company-store/get/storeName",
    businessCard:"base/applet-head-card/add2",
    queryBusinessCard:"base/applet-head-card/get/audit2"

}

// adminossfileupload =()=>{
//     return url.admin_oss_file_upload
//   };



let supnumb = (data) => {
    return http({
        url: url.supnumb,
        data: data,
        header: {
            'content-type': 'application/json'
        }
    })
}
let companyType = () => {
    return http({
        url: url.companyType,
        header: {
            'content-type': 'application/json'
        }
    })
}
let companystore = (data) => {
    return http({
        url: url.companystore,
        data: data,
        header: {
            'content-type': 'application/json'
        }
    })
}
let storeClass = () => {
    return http({
        url: url.storeClass,
        settoken: true,
        header: {
            'content-type': 'application/json'
        }
    })
}
let addstoreClass = (data) => {
    return http({
        url: url.addstoreClass,
        method: "POST",
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let updatastoreClass = (data) => {
    return http({
        url: url.updatastoreClass,
        method: "POST",
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let delstoreClass = (data) => {
    return http({
        url: `${url.delstoreClass}/${data.id}`,
        method: "POST",
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let parameterlist = () => {
    return http({
        url: url.parameterlist,
        header: {
            'content-type': 'application/json'
        }
    })
}
let companylist = (data) => {
    return http({
        url: url.companylist,
        data: data,
        header: {
            'content-type': 'application/json',
        }
    })
}
let companyitem = (data) => {
    return http({
        url: url.companyitem,
        data: data,
        header: {
            'content-type': 'application/json',
        }
    })
}
let speclist = () => {
    return http({
        url: url.speclist,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let createspec = (data) => {
    return http({
        url: url.createspec,
        method: "POST",
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let updataspec = (data) => {
    return http({
        url: url.updataspec,
        method: "POST",
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let delspec = (data) => {
    return http({
        url: url.delspec + "/" + data.id,
        method: "POST",
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let addproduct = (data) => {
    return http({
        url: url.addproduct,
        method: "POST",
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let productlist = (data) => {
    return http({
        url: url.productlist,
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let productcount = () => {
    return http({
        url: url.productcount,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let productalllist = (data) => {
    return http({
        url: url.productalllist,
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let upOrDown = (data) => {
    return http({
        url: url.upOrDown,
        method: "POST",
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}

let allclassifupdata = (data) => {
    return http({
        url: url.allclassifupdata,
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let supplierList = (data) => {
    return http({
        url: url.supplierList,
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let ourderlist = (data) => {
    return http({
        url: url.ourderlist,
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let ourderstartslist = () => {
    return http({
        url: url.ourderstartslist,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let ourderstate= () => {
    return http({
        url: url.ourderstate,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let ourderfalse= (data) => {
    return http({
        url: url.ourderfalse,
        method: "POST",
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let ourderconsig= (data) => {
    return http({
        url: url.ourderconsig,
        method: "POST",
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}

let ourdertermination= (data) => {
    return http({
        url: url.ourdertermination,
        method: "POST",
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let ourderReceipt= (data) => {
    return http({
        url: url.ourderReceipt,
        method: "POST",
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let ourderKTaudit= (data) => {
    return http({
        url: url.ourderKTaudit,
        method: "POST",
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let threeCountsample= (data) => {
    return http({
        url: url.threeCountsample,
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let earchOne= (data) => {
    return http({
        url: url.earchOne,
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let returnaddresslist= (data) => {
    return http({
        url: url.returnaddresslist,
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let returnaddress= (data) => {
    return http({
        url: url.returnaddress,
        data: data,
        method: "POST",
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let updatereturnaddress= (data) => {
    return http({
        url: url.updatereturnaddress,
        data: data,
        method: "POST",
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let squareSearch= (data) => {
  return http({
      url: url.squareSearch,
      data: data,
      method: "GET",
      settoken: true,
      header: {
          'content-type': 'application/json',
      }
  })
}
let storeSearch=(data) => {
  return http({
      url: url.storeSearch,
      data: data,
      method: "GET",
      settoken: true,
      header: {
          'content-type': 'application/json',
      }
  })
}
let businessCard=(data) => {
  return http({
      url: url.businessCard,
      data: data,
      method: "POST",
      settoken: true,
      header: {
          'content-type': 'application/json',
      }
  })
}
let queryBusinessCard=(data) => {
  return http({
      url: url.queryBusinessCard,
      data: data,
      method: "GET",
      settoken: true,
      header: {
          'content-type': 'application/json',
      }
  })
}
module.exports = {
    supnumb,
    companyType,
    companystore,
    storeClass,
    addstoreClass,
    updatastoreClass,
    delstoreClass,
    parameterlist,
    companylist,
    companyitem,
    createspec,
    updataspec,
    speclist,
    delspec,
    addproduct,
    productlist,
    productcount,
    productalllist,
    upOrDown,
    supplierList,
    allclassifupdata,
    ourderlist,
    ourderstartslist,
    ourderstate,
    ourderfalse,
    ourderconsig,
    ourdertermination,
    ourderReceipt,
    ourderKTaudit,
    threeCountsample,
    earchOne,
    returnaddresslist,
    returnaddress,
    updatereturnaddress,
    squareSearch,
    storeSearch,
    businessCard,
    queryBusinessCard
}

// export const userLogin = (data) => {
//     // console.log(http)
//     return http({
//       url: '/ipStrainer/createIpFilter',
//       method: 'post',
//       data
//     })
//   }